﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Syndication;
using PBDesk.Business.FeedsAggregator.Helper;
using PBDesk.Business.FeedsAggregator.Entities;

namespace PBDesk.Business.FeedsAggregator
{
    public class FeedManager
    {


        public static SyndicationFeedFormatter GetFeeds(string categoryName, int count = SyndicationHelper.DEFAULT_FEED_ITEM_COUNT)
        {
            FeedCategory category = CategoryManager.GetFeedsList(categoryName);
            return FeedHelper.GetFeeds(category, count);
        }

        public static SyndicationFeedFormatter GetFeeds(string categoryName, string subCategoryName, int count = SyndicationHelper.DEFAULT_FEED_ITEM_COUNT)
        {
            FeedCategory category = CategoryManager.GetFeedsList(categoryName, subCategoryName);
            return FeedHelper.GetFeeds(category, count);
        }

        public static SyndicationFeedFormatter GetFeeds(string x, string y, string z, int count = SyndicationHelper.DEFAULT_FEED_ITEM_COUNT)
        {
            return FeedHelper.GetFeeds(x+y+z);
        }

        public static SyndicationFeedFormatter GetFeeds(string x, string y, string z, string w, int count = SyndicationHelper.DEFAULT_FEED_ITEM_COUNT)
        {
            return FeedHelper.GetFeeds(x+y+z+w);
        }

        public static Rss20FeedFormatter GetFeeds(RssChannel channel, List<FeedProvider> providers)
        {
            return FeedHelper.GetRssFeeds(channel, providers);
        }

        public static Rss20FeedFormatter GetFeeds(SyndicationFeed feed, List<FeedProvider> providers, int itemCount = SyndicationHelper.DEFAULT_FEED_ITEM_COUNT)
        {
            return FeedHelper.GetRssFeeds(feed, providers, itemCount);
        }
    }
}
